package view

import (
	"github.com/gin-gonic/gin"
	"vrcm/src/vrcm/app/admin/apis/view_manage"
	"vrcm/src/vrcm/app/admin/router"
	"vrcm/src/vrcm/common/actions"
	"vrcm/src/vrcm/common/middleware"
)

func init() {
	router.NoCheckRole = append(router.NoCheckRole, registerViewLimitRouter)
}

// registerViewLimitRouter
func registerViewLimitRouter(v1 *gin.RouterGroup) {
	api := view_manage.ViewLimit{}
	r := v1.Group("/view-limit").Use(middleware.Cors())
	{
		r.GET("", actions.PermissionAction(), api.GetPage)
		r.POST("/get-by-bind-id", api.GetByBindId)
		r.POST("/insert", api.Insert)
		r.POST("/insert-or-update", api.Update)
		r.DELETE("", api.Delete)
		r.POST("/generate-view-code", api.GenerateViewCode)
		r.POST("/save-white-user", api.SaveWhiteUser)
		r.POST("/delete-white-user", api.DeleteWhiteUser)
		r.POST("/get-white-user", api.GetWhiteUser)
		r.POST("/check-white-user", api.CheckWhiteUser)
	}
}
